package org.linlinjava.litemall.db.dao.app;

import org.apache.ibatis.annotations.Param;
import org.linlinjava.litemall.db.domain.*;
import org.linlinjava.litemall.db.vo.app.PackageOrderListBackDto;
import org.linlinjava.litemall.db.vo.app.PickUpPriceDto;
import org.linlinjava.litemall.db.vo.app.ReturnSubOrderGoodsVo;
import org.linlinjava.litemall.db.vo.app.SaleLogisticsDto;

import java.util.List;

public interface AppOrderMapper {
    List<LitemallOrder> orderList(@Param("userId") Integer userId, @Param("keyword") String keyword,
                                  @Param("subOrderStatus") List<Short> subOrderStatus, @Param("isService") Integer isService,
                                  @Param("bigOrderId") String bigOrderId);

    List<LitemallOrderItem> subOrderList(@Param("userId") Integer userId, @Param("parentId") Integer parentId,
                                         @Param("subOrderStatus") List<Short> subOrderStatus, @Param("isService") Integer isService);

    List<LitemallOrderGoods> queryServiceByOid(@Param("orderId") Integer orderId, @Param("isService") Integer isService);

    List<LitemallOrderGoods> queryOrderGoodsByBigOrderIds(@Param("bigOrderIdList") List<Integer> bigOrderIdList, @Param("isService") Integer isService);

    /**
     * 找到与子订单 一个大订单下的其他子订单租赁商品
     *
     * @param bigOrderId
     * @param subOrderId
     * @return
     */
    List<ReturnSubOrderGoodsVo> getSubOrderListByBigOrderId(@Param("userId") Integer userId, @Param("bigOrderId") Integer bigOrderId, @Param("subOrderId") Integer subOrderId);

    AgedmallOrderMsg getOrderMsgInfo(@Param("orderId") Integer orderId);

    Integer unAftersaleGoodsCount(@Param("orderId") Integer orderId);

    LitemallOrderItem queryByRfid(@Param("rfid") String rfid);

    List<PackageOrderListBackDto> getPackageOrderList(@Param("phone") String phone, @Param("state") Integer state, @Param("printCode") Integer printCode,
                                                      @Param("type") Integer type, @Param("missionList") List<Integer> missionList);

    AgedmallLgReceiveOrder getPackageUserMessage(@Param("baseInfoId") Integer baseInfoId);

    List<SaleLogisticsDto> getLogisticsMessage(@Param("list") List<Long> list);

    List<PickUpPriceDto> getPickUpPriceAndGoodsPrice(@Param("list") List<Integer> list);

    List<SaleLogisticsDto> getOneLogisticsMessage(@Param("id") Integer id);

    List<AgedmallLeaseGoodsReturnRecord> getLeaseReturnGoodsMessage(@Param("subOrderId") Integer subOrderId);

    List<Integer> getUnOrderMissionIdList(@Param("phone") String phone);

    Long getNowUserRecordOnce(@Param("userId") Integer userId, @Param("missionId") Integer missionId);

    List<Long> getCanUseHospitalEquIdList(@Param("locationId")Long locationId);
}
